import client from "../../utils/pool.mjs"
import { returnResponse, jsonResponse } from "../../utils/index.mjs";
import { httpCode } from '../../utils/httpCode.mjs'
import { verifyAuth } from '@/service/auth.mjs'
export async function GET(request) {
    let userInfo = {}
    try {
        userInfo = await verifyAuth(request)
    } catch (e) {
        return jsonResponse(httpCode.BAD_REQUEST, { error_msg: '用户异常' })
    }
    const user = await client.user.findFirst({
        where: {
            id: userInfo.user_id
        }
    })
    return returnResponse(user)
}
